#!/bin/bash
# 重新编译项目, 并重新部署
# bash run.sh -b

set -eux
proj_root=$(dirname $(realpath $0))
cd $proj_root

echo '-b or --build, first build before run server'

if [[ $* =~ "-b" ]] || [[ $* =~ "--build" ]]
then
    bash build.sh
fi

docker rm -f gin1 || echo 'rm server'
docker run -d --name gin1 -p 8080:8080  ccr.ccs.tencentyun.com/mkmk-common/ymk:go-demo-01 
